#define CharacterInit
/* Character Creation Script
 * argument0 vitality + 32 * (wisdom + 32 * (intelligence + 32 * class))
 * argument1 spells bit set value + (1 << (SPELL_SIZE * 4))
 * argument2 checkpoint number
 * argument3 name of the character
 */
//0,0 for now. When checkpoint data structure is implemented will use the checkpoint.
//char = instance_create(0, 0, Character);
char = Character;
//unpack the values for vitality, wisdom, intelligence and class
char.vit = argument0 mod global.MAX_STAT_VALUE;
argument0 = (argument0 - char.vit) div global.MAX_STAT_VALUE;
char.wis = argument0 mod global.MAX_STAT_VALUE;
argument0 = (argument0 - char.wis) div global.MAX_STAT_VALUE;
char.int = argument0 mod global.MAX_STAT_VALUE;
argument0 = (argument0 - char.int) div global.MAX_STAT_VALUE;
char.class = argument0;

//unpack spelss and level
char.spells = argument1 mod (1 << (global.SPELL_SIZE * global.TREE_NUMBER));
char.level = argument1 div (1 << (global.SPELL_SIZE * global.TREE_NUMBER));
char.checkpoint = argument2;

//set character name
char.name = argument3

